//
//  QLMessageView.m
//  QLTiyufeng_IOS3.X
//
//  Created by anan on 14/11/28.
//  Copyright (c) 2014年 baobaodev_anan. All rights reserved.
//

#import "QLMessageView.h"

@implementation QLMessageView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)setMessageInfo:(NSDictionary *)messageInfo
{
    _messageInfo = messageInfo;
    self.labelContent.text = self.messageInfo[@"content"];
    [self performSelector:@selector(end) withObject:nil afterDelay:3];
}

- (void)end
{
    self.alpha = 1.0f;
    [UIView animateWithDuration:0.4 animations:^{
        self.alpha = 0.0f;
        CGRect r = self.frame;
        r.origin.y = r.origin.y+55;
        self.frame = r;
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}

- (IBAction)buttonOpenAction:(id)sender
{
    [self end];
//    QLAppDelegate *delegate = (QLAppDelegate*)([UIApplication sharedApplication].delegate);
//    [QLPlayerManager openNotice:self.messageInfo withNavigation:delegate.navigationController];
}

@end
